package com.centerm.common.exception;

import com.centerm.common.constant.ErrorCode;
import com.centerm.common.constant.error.GlobalErrorEnum;

public class MyRuntimeException extends RuntimeException {
    /**
     * 
     */
    private static final long serialVersionUID = 8668371514946335870L;
    private ErrorCode response;
    private String description = null;

    public MyRuntimeException(ErrorCode response) {
        super(response.getMsg());
        this.response = response;
    }

    public MyRuntimeException(String message) {
        super(message);
        this.description = message;
        this.response = GlobalErrorEnum.UNKNOWN_ERROR;
    }

    public MyRuntimeException(Throwable cause) {
        super(cause);
        this.response = GlobalErrorEnum.UNKNOWN_ERROR;
    }

    public ErrorCode getResponse() {
        return response;
    }
    
    public String getDescription() {
        return description;
    }
}
